package _15ArrayList底层原理.练习;

import java.util.ArrayList;
import java.util.List;

public class Test {
    public static void main(String[] args) {

        ArrayList<Student> students = new ArrayList<>();
        students.add(new Student("张三",18));
        students.add(new Student("李四",11));
        students.add(new Student("王三",21));

        Student mins = students.get(0);

        for (int i = 0; i < students.size(); i++) {
            if (mins.getAge()>students.get(i).getAge()){
                mins = students.get(i);
            }
        }

        System.out.println(mins);



    }
}
